

using System.Collections.Generic;

namespace Client.Base
{
    public class BaseLogic : ILogic
    {
        protected readonly List<IAwake> awakes = new();
        protected readonly List<ITick> ticks = new();
        protected readonly List<IDestroy> destroys = new();

        public virtual void Awake()
        {
            for (int i = 0; i < awakes.Count; i++)
            {
                awakes[i].Awake();
            }
        }
        public virtual void Tick()
        {
            for (int i = 0; i < ticks.Count; i++)
            {
                ticks[i].Tick();
            }
        }
        public virtual void Destroy()
        {
            for (int i = 0; i < destroys.Count; i++)
            {
                destroys[i].Destroy();
            }

            awakes.Clear();
            ticks.Clear();
            destroys.Clear();
        }
    }

}
